

with open('srt_txt/文案.txt', 'r', encoding='utf-8') as f:
    lines = f.readlines()

new_text = ''
for line in lines:
    if not line.strip().isdigit() and line.strip() != '':
        new_text += line

with open('srt_txt/文案_音.txt', 'w', encoding='utf-8') as f:
    f.write(new_text)


# 读取文件内容
with open("srt_txt/文案_音.txt", "r", encoding='utf-8') as f:
    lines = f.readlines()

# 在每一段后面加上“。”
lines = [line.strip() + "。\n" for line in lines]

# 将修改后的内容写入文件
with open("srt_txt/文案_音.txt", "w", encoding='utf-8') as f:
    f.writelines(lines)